home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 June
/
CHIP Haziran 2001.iso
/
prog
/
haziran
/
19
/
setup.exe
/
data.z
/
windrvr_net.h
< prev
next >
Wrap
C/C++ Source or Header
|
2001-04-11
|
2KB
|
117 lines
#if !defined(_WINDRVR_NET_H_)
#define _WINDRVR_NET_H_
#if defined(_WINDRVR_H_)
#error "you must include windrvr_net.h before windrvr.h"
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#include "windrvr.h"
typedef void (*WD_CLOSE_FUNC) (HANDLE);
typedef unsigned long (*WD_FUNCTION_FUNC) (DWORD, HANDLE, PVOID, DWORD, BOOL);
typedef struct
{
HANDLE mutex;
char ip[128];
DWORD port;
} net_params_t;
typedef struct
{
WD_CLOSE_FUNC wd_close_func;
WD_FUNCTION_FUNC wd_function_func;
HANDLE h;
net_params_t *net_pr;
BOOL is_wince;
BOOL is_remote;
} *WD_HANDLE;
typedef struct
{
DWORD dwPort;
char pcIP[128];
BOOL fWinCE;
} WD_OPENNET;
typedef struct
{
DWORD dwVer;
CHAR cVer[100];
CHAR cOs[100];
} WD_VERSION_NET;
static void WD_CloseLocal_Call(HANDLE h)
{
WD_CloseLocal(h);
}
static ULONG WD_FUNCTION_LOCAL_CALL(DWORD wFuncNum, HANDLE h,
PVOID pParam, DWORD dwSize, BOOL fWait)
{
return WD_FUNCTION_LOCAL(wFuncNum, h, pParam, dwSize, fWait);
}
static HANDLE WD_Open()
{
WD_HANDLE hWD;
hWD = (WD_HANDLE)malloc(sizeof(*hWD));
BZERO(*hWD);
hWD->h = WD_OpenLocal();
if (hWD->h==INVALID_HANDLE_VALUE)
{
free(hWD);
return INVALID_HANDLE_VALUE;
}
hWD->wd_close_func = WD_CloseLocal_Call;
hWD->wd_function_func = WD_FUNCTION_LOCAL_CALL;
return (HANDLE) hWD;
}
HANDLE WD_OpenNet(WD_OPENNET *pOpenNet);
#define NET_REQUEST_WD_VERSION 1
ULONG WD_VersionNet(HANDLE h, PVOID pBuf);
static void WD_Close(HANDLE h)
{
WD_HANDLE hWD = (WD_HANDLE)h;
HANDLE hWD1;
WD_CLOSE_FUNC c_f = hWD->wd_close_func;
if (!hWD->is_remote)
{
hWD1 = hWD->h;
free (hWD);
}
else
hWD1 = (HANDLE)hWD;
c_f(hWD1);
}
static ULONG WD_FUNCTION(DWORD wFuncNum, HANDLE h,
PVOID pParam, DWORD dwSize, BOOL fWait)
{
WD_HANDLE hWD = (WD_HANDLE) h;
HANDLE hWD1;
if (!hWD->is_remote)
hWD1 = hWD->h;
else
hWD1 = (HANDLE)hWD;
return hWD->wd_function_func(wFuncNum, hWD1, pParam, dwSize, fWait);
}
#ifdef __cplusplus
}
#endif
#endif